package com.ky.gp.app.service;

import com.ky.common.param.ArticleAdd;
import com.ky.common.vo.R;
import com.ky.gp.app.config.OpenFeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(value = "gp-study-server",configuration = OpenFeignConfig.class)
public interface ArticleFeign {
    @RequestMapping("/study/article/addArticle")
    R addArticle(ArticleAdd articleAdd);

    @RequestMapping("/study/article/commentsCount/{articleId}/commentsCount")
    R commentsCount(@PathVariable("articleId") int articleId);
    @RequestMapping("/study/article/goods/{articleId}/goods")
    R addGoods2(@PathVariable("articleId") int articleId);
    @RequestMapping("/study/article/goods/{articleId}")
    R addGoods(@PathVariable("articleId")int articleId);

    @RequestMapping("/study/article/addViews/{articleId}")
    R addViews(@PathVariable("articleId") int articleId);
    @RequestMapping("/study/article/selectByArticleId/{articleId}")
    R selectByArticleId(@PathVariable("articleId")int articleId);
    @RequestMapping("/study/article/js")
    R js();
    @RequestMapping("/study/article/jzs")
    R jzs();

    @RequestMapping("/study/article/kt")
    R kt();

    @RequestMapping("/study/article/alfx")
    R alfx();
    @RequestMapping("/study/article/bkjy")
    R bkjy();
    @RequestMapping("/study/article/search")
    R search(@RequestParam("keyword")String keyword);

    @RequestMapping("/study/article/all")
    R all();
    @PostMapping(value= "/study/article/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    R uploadFile(@RequestPart("file") MultipartFile file);

}
